home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
U-Utilities
/
(c)u1.d64
/
viclist.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
4KB
|
110 lines
0 POKE53280,1:POKE53281,1
2 REM DISK LISTER BY BUTTERFIELD COMPUTE! DEC 82-PG194 ADAPTED BY CHUCK WALLACE
4 PRINT"[147] VIC DISKLIST":PRINT" INSTRUCTIONS ?":PRINT" (Y OR N)"
6 GETZ$:IFZ$=""THEN6
8 IFZ$="Y"THEN196
10 PRINT"[144][147]PLEASE WAIT....":GOTO160
12 REM ** CHECK FOR DISK ERROR **************************
14 INPUT#15,EN$,EM$,ET,ES:IFEN$="00"THENRETURN
16 PRINT"DISK ERROR:[146]"EM$;" ";EN$;ET;",";ES:END
18 REM ** CHECK FOR NEW PAGE ***************************
20 K%=K%+1:IFK%<J%THENRETURN
22 K%=0:FORI=1TOX1%:PRINT#4:NEXT:RETURN:REM ** PAGE FOWARDING ** X1% IS SPACING **
24 REM ** OUTPUT ****************************************
26 IFLEN(P$)<L9THENRETURN
28 FORJ=L9TOL9*.6STEP-1:IFMID$(P$,J,1)=":"THEN36
30 NEXTJ:FORJ=L9-1TOL9*.6-1STEP-1:P=ASC(MID$(P$,J)):IFP=91THEN36
32 IFP=59ORP=44ORP=93THENJ=J+1:GOTO36
34 NEXTJ:J=L9-1
36 PRINT#4,LEFT$(P$,J-1):GOSUB20:IFL<2THENL=2
38 K=INT(LOG(L)/LOG(10)+3):L1$="":FORK2=1TOK:L1$=L1$+" ":NEXTK2:P$=L1$+MID$(P$,J):RETURN
40 REM ** CLOSE OFF CURSOR EXPRESSION ******************
42 IFF1=0THENRETURN
44 IFB>0THENP$=P$+MID$(STR$(B+1),2):GOSUB26
46 B=0:F1=0:B1$="":P$=P$+P2$:GOSUB26:F$=P1$:RETURN
48 REM ** START PGM ************************************
50 CLOSE1:PRINT"[147]LOAD CORRECT DISK":PRINT"NAME OF PROGRAM":INPUTG$:OPEN15,8,15,"I"
52 OPEN1,8,3,G$+",P,R":B$="":GET#1,A$,B$:IFA$<>CHR$(1)ANDA$<>""THEN50
54 IFA$=""THENA$=CHR$(1):GET#1,X$
56 PRINT"LINE NUMBER RANGE":INPUT" -[157][157][157]";Z$:L0=0:L1=0:L2=1E9:FORJ=1TOLEN(Z$)
58 Y$=MID$(Z$,J,1):Y=ASC(Y$):IFY>=48ANDY<=57THEN62
60 IFY<>32THENL0=J:IFY<>45THEN68
62 NEXTJ
64 IFL0<LEN(Z$)THENL2=VAL(MID$(Z$,L0+1)):IFL2=0THENL2=1E9
66 L1=L2:IFL0THENL1=VAL(Z$)
68 K%=1:P1$="[":P2$="]":P%=4:REM P% =PRINTR
70 PRINT"GRAPHICS OR TEXT (G/T)":INPUT" G[157][157][157]";Z$
72 PRINTCHR$(142):X%=0:IFASC(Z$)=84THENPRINTCHR$(14):X%=7:REM ** X% GIVES UPPER/LOWER PRINT **
74 PRINT"COUNT CURSOR MOVES (Y/N)":INPUT" Y[157][157][157]";Z$:IFZ$="Y"THENT7=1
76 PRINT"WHAT LINE LENGTH (60)":INPUTL9
78 PRINT"WHAT PAGE LENGTH (55)":INPUTJ%
80 PRINT"WHAT SPACING BETWEEN PAGES (9)":INPUTX1%
82 IFJ%<1THENJ%=55
84 IFL9<1THENL9=60
86 IFX1%<1THENX1%=9
88 OPEN4,P%,X%:F$=P1$:PRINT#4," PROGRAM: ";G$
90 REM ** NEW LINE *************************************
92 GOSUB42:Q=0:T1=1:C1=-1:GET#1,A$,B$:IFST<>0ORB$=""THEN146:*LINK ADDRESS*
94 GET#1,A$,B$:GOSUB14:REM* LINE # *
96 L=ASC(A$+CHR$(0))+ASC(B$+CHR$(0))*256
98 IFL<L1THEN142
100 IFL>L2THEN146
102 F2=1:PRINT#4,P$:P$=STR$(L)+" ":GOSUB20
104 REM ** START TEXT HERE ******************************
106 GET#1,A$:GOSUB14:IFA$=""THEN92
108 T=0:A=ASC(A$):IFA=32THENIFF$=","THEN112
110 IFQ=0OR(AAND127)>31ORT7=0THEN124
112 FORJ=0TOF%:IFA=A(J)THENB$=A$(J):GOTO116
114 NEXTJ:GOTO130
116 IFB$=B1$THENB=B+1:GOTO106
118 IFBTHENA$=MID$(STR$(B+1),2)+F$+B$:GOTO122
120 A$=F$+B$
122 B=0:B1$=B$:F$=",":F1=1:GOTO132
124 A=A-128:IFA<0ORQ<>0THEN130
126 IFA=127THENA$="":GOTO130
128 T=1:A$=K$(A):IFA=15THENQ=2
130 GOSUB42
132 IFA$=CHR$(34)THENQ=1-Q
134 C=ASC(LEFT$(A$,1)):C=(C<48ORC>57)AND(C<65ORC>90):REM ** C=-1 FOR ALPHANUMERIC**
136 IFT<>T1ORT=1THENT1=T:IFNOTCTHENIFNOTC1THENP$=P$+" ":GOSUB26
138 C=ASC(RIGHT$(A$,1)):C1=((C<48ORC>57)AND(C<65ORC>90))ORA=37:P$=P$+A$:GOSUB26:GOTO106
140 REM ** SKIP TO NEXT LINE ****************************
142 GET#1,A$:GOSUB14:IFA$=""THEN92
144 GOTO142
146 IFLEN(P$)THENF2=1:PRINT#4,P$:GOSUB20
148 IFF2=0THENPRINT"** NO LINES FOUND **"
150 CLOSE1:GOSUB42:PRINT#4:CLOSE4:CLOSE15
152 PRINT" ANOTHER ?"
154 GETZ$:IFZ$=""THEN154
156 IFZ$="Y"THEN50
158 END
160 F%=40:H%=256
162 DIMA(F%),A$(F%),K$(90):REM A()= SPECIAL, A$()= CURSOR CONTROLS, K$()= BASIC
164 FORI=.TO254:P$=P$+CHR$(65):NEXTI:P$=""
166 FORJ=0TOF%:READA(J):NEXT:FORJ=S%TOF%:READA$(J):NEXT:FORJ=0TO89:READK$(J):NEXT:GOTO50
168 DATA19,147,17,145,29,157,18,146,20,148,141,32
170 REM 80-COLUMN CURSOR STUFF
172 DATA7,21,149,22,150,14,142,25,153,15,143
174 REM VIC STUFF
176 DATA144,5,28,159,156,30,31,158,8,9,133,137,134,138,135,139,136,140
178 DATAHOME,CLEAR,DOWN,UP,RIGHT,LEFT,RVS,RVOFF,DEL,INST,S.RETURN,SPACE
180 DATABELL,D.LINE,I.LINE,ER.BEGIN,ER.END,TEXT,GRAPHIC,SCROLL.UP,SCROLL.DOWN,TOP,BOTTOM
182 DATABLACK,WHITE,RED,CYAN,MAGENTA,GREEN,BLUE,YELLOW,LOCK,UNLOCK,F1,F2,F3,F4,F5,F6,F7,F8
184 DATAEND,FOR,NEXT,DATA,INPUT#,INPUT,DIM,READ,LET,GOTO,RUN,IF,RESTORE,GOSUB
186 DATARETURN,REM,STOP,ON,WAIT,LOAD,SAVE,VERIFY,DEF,POKE,PRINT#,PRINT,CONT
188 DATALIST,CLR,CMD,SYS,OPEN,CLOSE,GET,NEW,TAB(,TO,FN,SPC(,THEN,NOT,STEP
190 DATA+,-,*,/,^,AND,OR,>,=,<,SGN,INT,ABS,USR,FRE,POS,SQR,RND,LOG,EXP,COS
192 DATASIN,TAN,ATN,PEEK,LEN,STR$,VAL,ASC,CHR$,LEFT$,RIGHT$,MID$,GO,CONCAT,DOPEN,DCLOSE
194 DATARECORD,HEADER,COLLECT,BACKUP,COPY,APPEND,DSAVE,CATALOG,RENAME,SCRATCH,DIRECTORY
196 PRINT"[144][147]THE CONFIGURATION IS":PRINT"A VIC-20 (>8K) OR 64,"
197 PRINT"1525 PRINTER, & A":PRINT"1541 DISK."
198 PRINT"LOAD[146] THE CORRECT DISK"
200 PRINT" ********************"
202 PRINT"PROMPTS ARE FOR:"
204 PRINT"1. NAME - EXACT NAME AND/OR WILDCARDS"
206 PRINT"2. LINE LENGTH -SET AT60[146] BUT CAN BE CHANGED"
208 PRINT"3. PAGE LENGTH -SET AT57[146] BUT CAN BE CHANGED"
210 PRINT"HIT A KEY TO CONTINUE";
212 GETY$:IFY$=""THEN212
214 GOTO10